<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<head>
<title>修改登录密码</title>
<link type="text/css" rel="stylesheet" href="css/modifyORFind.css" />
</head>
<body>
<div id="wrapper">
  <div id="top"> <img src="i/logo.png" width="100" height="50" alt="中软国际" />
    <h1>中国现代化支付系统</h1>
    <div id="top_right"><span id="index"><a href="login.html">登录</a>·<a href="register.html">注册</a></span> </div>
    <div class="clear"></div>
    <hr />
  </div>
  <iframe src="nav.html" width="100%" height="45px" scrolling="no" frameborder="0"></iframe>
  <div id="main">
  <br />
	<span>修改登录密码</span><img src="i/more.png"/>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<span id="showWrong"></span>
	<div id="modify_box">
		<form id="modify_pwd" name="modify_form" method="post" action="/cnaps/login!changePassword.do">
		  <table>
			<tr>
			  <td align="right"><label for="password">当前密码:</label></td>
			  <td colspan="2"><input type="password" name="current_password" id="current_password" /></td>
			 </tr>
			<tr>
			  <td align="right"><label for="password">新密码:</label></td>
			  <td colspan="2"><input type="password" name="new_password_1" id="new_password_1" /></td>
			</tr>
			<tr>
			  <td align="right"><label for="password">确认新密码:</label></td>
			  <td colspan="2"><input type="password" name="new_password_2" id="new_password_2" /></td>
			</tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td><input type="submit"  value="确认" /></td>
              <td>&nbsp;</td>
            </tr>
		  </table>
		</form>
	</div>

	<div class="clear"></div>
  </div>

  <iframe src="footer.html" width="100%" height="55px" scrolling="no" frameborder="0"></iframe>
</div>
</body>
	<script type="text/javascript">
		inneter();
		function inneter(){
			var changeResult = '${changeResult}';
			if(changeResult==-1){
				document.getElementById("showWrong").innerHTML="当前密码输入错误！";
			}else if(changeResult==-2){
				document.getElementById("current_password").value="${current_password}";
				document.getElementById("showWrong").innerHTML="新密码确认错误！";
			}else if(changeResult==-3){
				document.getElementById("showWrong").innerHTML="无法修改密码，请联系管理员！";
			}else if(changeResult==1){
				alert('密码修改成功！');
				window.location.href="main.jsp";
			}
		}	
	</script>
</html>